package com.gragra.util;
import java.io.BufferedReader;
import java.io.IOException;
/**
 * This class can be used to iterate over the lines from a buffered reader and
 * apply some method to them by overriding the apply method
 * @author Christoph Teichmann
 * @version 0.1
 */
public class FileLineForEach
{
	/**
	 * creates an instance and iterates over the lines from the given reader
	 * @param from
	 * @throws IOException
	 */
	public FileLineForEach(final BufferedReader from) throws IOException
	{
		String line;
		while ((line = from.readLine()) != null)
		{
			apply(line);
		}
	}
	/**
	 * this method is called with the lines from the reader can be overriden to
	 * achieve some effect
	 * @param line
	 */
	public void apply(final String line)
	{
	}
}